const path = require("path"); // 路径模块
const resolveDir = dir => path.join(__dirname, dir);
module.exports = {
  outputDir: 'line12-4k',
  lintOnSave: false,
  productionSourceMap: false,
  //   // 在暴露的配置对象添加如下配置
  configureWebpack: {
    devServer: {
      port: 8001,
      proxy: {
        "^/svgPicture": {
          target: "http://172.17.0.100:8881",
          changeOrigin: true
        }
      }
    }
  },
  css: {
    loaderOptions: {
      // postcss-pxtorem 具体配置
      postcss: {
        plugins: [
          require("postcss-pxtorem")({
            rootValue: 192, // 设计稿宽度的1/10（基础分辨率 1920 * 1080）
            propList: ["*"] // 需要做转化处理的属性，如`hight`、`width`、`margin`等，`*`表示全部
          })
        ]
      }
    }
  },
  chainWebpack: config => {
    config.resolve.symlinks(true); // 修复 热更新 失效

    // 添加目录别名
    config.resolve.alias
      .set("@", resolveDir("src"))
      .set("@assets", resolveDir("src/assets"))
      .set("@components", resolveDir("src/components"))
      .set("@views", resolveDir("src/views"))
      .set("@img", resolveDir("src/assets/img"));
  }
};
